package com.example.demo.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 时间转换
 */
public class DateUtils {

    public static String dates(){
        Date date=new Date();
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
        String d=sdf.format(date);
        return d;

    }
    public static String dates(Date date,String format){
        SimpleDateFormat sdf=new SimpleDateFormat(format);
        String d=sdf.format(date);
        return d;

    }





}
